Skip to content

Conversation

@marcleblanc2
Copy link
Contributor

@marcleblanc2 marcleblanc2 commented Mar 31, 2025

Linear issue: REL-809: Investigate why Grafana is not showing Prometheus data

Checklist

Test plan

Tested with a customer self-hosting on k3s, and on our AMI running k3s

@marcleblanc2 marcleblanc2 requested a review from Copilot March 31, 2025 21:56
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR adds a Prometheus ConfigMap override specifically for k3s environments and updates accompanying documentation.

  • Introduces a new Prometheus configMap with custom scrape and relabel configurations for k3s and cAdvisor compatibility.
  • Updates the README to document how and why to use this override.

Reviewed Changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 2 comments.

File Description
charts/sourcegraph/examples/prometheus/prometheus-override-k3s.ConfigMap.yaml New Prometheus override ConfigMap with custom scrape_configs for k3s
charts/sourcegraph/examples/prometheus/README.md Documentation for applying the override ConfigMap

- source_labels: [__meta_kubernetes_node_name]
regex: (.+)
target_label: __metrics_path__
replacement: /api/v1/nodes/${1}/proxy/metrics/cadvisor
Copy link

Copilot AI Mar 31, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Replace '${1}' with '$1' to use the correct capture group syntax in Prometheus replacement patterns.

Suggested change
replacement: /api/v1/nodes/${1}/proxy/metrics/cadvisor
replacement: /api/v1/nodes/$1/proxy/metrics/cadvisor

Copilot uses AI. Check for mistakes.
- source_labels: [__address__, __meta_kubernetes_pod_annotation_prometheus_io_port]
action: replace
regex: (.+):(?:\d+);(\d+)
replacement: ${1}:${2}
Copy link

Copilot AI Mar 31, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Replace '${1}:${2}' with '$1:$2' to ensure proper capture group referencing in Prometheus replacement patterns.

Suggested change
replacement: ${1}:${2}
replacement: $1:$2

Copilot uses AI. Check for mistakes.
@marcleblanc2 marcleblanc2 requested a review from a team March 31, 2025 23:03
@marcleblanc2 marcleblanc2 enabled auto-merge (squash) March 31, 2025 23:04
@marcleblanc2 marcleblanc2 merged commit eb39c03 into main Mar 31, 2025
9 checks passed
@marcleblanc2 marcleblanc2 deleted the marc/add-prometheus-override-for-k3s branch March 31, 2025 23:06
enriquegh pushed a commit that referenced this pull request Jul 10, 2025
Linear issue: [REL-809: Investigate why Grafana is not showing
Prometheus
data](https://linear.app/sourcegraph/issue/REL-809/investigate-why-grafana-is-not-showing-prometheus-data)

### Checklist

- [x] Follow the [manual testing
process](https://github.com/sourcegraph/deploy-sourcegraph-helm/blob/main/TEST.md)
- [ ] Update
[changelog](https://github.com/sourcegraph/deploy-sourcegraph-helm/blob/main/charts/sourcegraph/CHANGELOG.md)
- [ ] Update [Kubernetes update
doc](https://docs.sourcegraph.com/admin/updates/kubernetes)

### Test plan

Tested with a customer self-hosting on k3s, and on our AMI running k3s

<!--
As part of SOC2/GN-104 and SOC2/GN-105 requirements, all pull requests
are REQUIRED to
provide a "test plan". A test plan is a loose explanation of what you
have done or
implemented to test this, as outlined in our Testing principles and
guidelines:

https://docs.sourcegraph.com/dev/background-information/testing_principles
  Write your test plan here after the "Test plan" header.
-->
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants